<?php

namespace App\Models;

use Eloquent as Model;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * Class Comment
 *
 * @package App\Models
 * @version January 9, 2017, 3:02 pm UTC
 * @property int $id
 * @property int $post_id 外键
 * @property int $parent_id 父评论id
 * @property string $username 评论者用户名
 * @property string $email 评论者邮箱
 * @property string $content 评论内容
 * @property \Carbon\Carbon $created_at
 * @property \Carbon\Carbon $updated_at
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Comment whereId($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Comment wherePostId($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Comment whereParentId($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Comment whereUsername($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Comment whereEmail($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Comment whereContent($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Comment whereCreatedAt($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Comment whereUpdatedAt($value)
 * @mixin \Eloquent
 */
class Comment extends Model
{
//    use SoftDeletes;

    public $table = 'comments';
    
    const CREATED_AT = 'created_at';
    const UPDATED_AT = 'updated_at';


    protected $dates = ['deleted_at'];


    public $fillable = [
        'post_id',
        'parent_id',
        'username',
        'email',
        'content'
    ];

    /**
     * The attributes that should be casted to native types.
     *
     * @var array
     */
    protected $casts = [
        'id' => 'integer',
        'post_id' => 'integer',
        'parent_id' => 'integer',
        'username' => 'string',
        'email' => 'string',
        'content' => 'string'
    ];

    public function labels(){
        return [];
    }

    /**
     * Validation rules
     *
     * @var array
     */
    public static $rules = [
        
    ];

    
}
